<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>乐淘-后台管理系统</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/bootstrap-validator/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="assets/nprogress/nprogress.css">
    <link rel="stylesheet" href="css/admin.css">
    <link rel="stylesheet" href="css/product.css">
</head>
<body>
    <aside class="aside_left">
        <div class="brand text-center">
            <a href="index.html">ITCAST</a>
        </div>
        <div class="user">
            <img src="images/default.png" alt="">
            <span>管理员</span>
        </div>
        <div class="menu">
            <ul>
                <li><a href="userManage.html"><span class="glyphicon glyphicon-user"></span> 用户管理</a></li>
                <li>
                    <a href="javascript:;"><span class="glyphicon glyphicon-list"></span> 分类管理</a>
                    <div class="child">
                        <a href="categoryFirst.html">一级分类</a>
                        <a href="categorySecond.html">二级分类</a>
                    </div>
                </li>
                <li><a class="now" href="productManage.html"><span class="glyphicon glyphicon-tags"></span> 商品管理</a></li>
            </ul>
        </div>
    </aside>
    <section>
        <nav>
                <a class="link_left" href="javascript:;"><span class="glyphicon glyphicon-align-justify"></span></a>
                <a class="link_right" href="javascript:;"><span class="glyphicon glyphicon-log-out"></span></a>
        </nav>
        <div class="container-fluid">
            <ol class="breadcrumb">
                <li><a href="#">管理系统</a></li>
                <li class="active">商品管理</li>
            </ol>
            <div class="ad_content">
                    <span class="btn btn-primary add-btn">添加商品</span>
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th width="10%">商品编号</th>
                                <th width="20%">商品名称</th>
                                <th width="20%">商品描述</th>
                                <th width="10%">商品库存</th>
                                <th width="10%">商品尺寸</th>
                                <th width="10%">是否下架</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                                
                        </tbody>
                    </table>
                    <ul id='paginator'></ul>
                </div>
        </div>
        
    </section>
    <div class="modal fade" id="editModal">
            <div class="modal-dialog modal-md">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title">添加商品</h4>
                    </div>
                    <div class="modal-body">
                        <form action="#" id="form" autocomplete="off">
                            <div class="form-group">
                                <div class="dropdown">
                                    请选择品牌：
                                    <button id="dLabel" class="btn" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <span class="choose">请选择</span>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" aria-labelledby="dLabel">
                                       
                                    </ul>
                                </div>
                                <input type="hidden" name="brandId">
                            </div>
                            <div class="form-group">
                                <input type="text" name="proName" class="form-control" placeholder="请输入产品名称">
                            </div>
                            <div class="form-group">
                                <textarea type="text" name="proDesc" class="form-control" placeholder="请输入产品描述"></textarea>
                            </div>
                            <div class="form-group">
                                <input type="text" name="num" class="form-control" placeholder="请输入产品数量">
                            </div>
                            <div class="form-group">
                                <input type="text" name="size" class="form-control" placeholder="请输入产品尺码，如35-45">
                            </div>
                            <div class="form-group">
                                <input type="text" name="oldPrice" class="form-control" placeholder="请输入产品原价">
                            </div>
                            <div class="form-group">
                                <input type="text" name="price" class="form-control" placeholder="请输入产品折扣价">
                            </div>
                            <div class="form-group upload">
                                <input type="file" name="pic1" class="form-control" id="fileupload" data-url="/product/addProductPic">
                                <!-- <input type="hidden" name="pic1"> -->
                                <span class="btn btn-default load">选择需要上传的图片</span>
                                <span>请选择三张图片</span>
                            </div>
                            <div class="form-group image">
                               
                            </div>
                        </form>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="submit" class="btn btn-primary" form="form">确定</button>
                        
                        </div>
                    </div>
                </div>
            </div>
        </div>


    <script type="text/template" id="template">
        <% for(var i = 0; i< rows.length;i++){%>
        <tr>
            <td width="10%"><%=(page-1)*size+1+i%></td>
            <td width="20%"><%=rows[i].proName%></td>
            <td width="20%"><%=rows[i].proDesc%></td>
            <td width="10%"><%=rows[i].num%></td>
            <td width="10%"><%=rows[i].size%></td>
            <td width="10%"><%=rows[i].statu==1?'上架':'下架'%></td>
            <td>
                <% if(rows[i].statu==1){%>
                <a href="javascript:;" class="btn btn-sm btn-primary updown">下架</a>
                <% }else{%>
                <a href="javascript:;" class="btn btn-sm btn-danger updown">上架</a>
                <% }%>
                <span><a href="javascript:;" class="btn btn-sm btn-success">编辑</a></span>
            </td>
        </tr>
        <% }%>
    </script>
    <script type="text/template" id="dropdown">
        <% for(var i = 0; i< rows.length;i++){%>
        <li data-id="<%=rows[i].id%>"><%=rows[i].brandName%></li>
        <% }%>
    </script>

    <script src="assets/jquery/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <script src="assets/nprogress/nprogress.js"></script>
    <script src="assets/artTemplate/template-native.js"></script>
    <script src="assets/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <script src="assets/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="assets/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="js/admin.js"></script>
    <script src="js/product.js"></script>
</body>
</html>